/**
 * Created By zhangQ 2018/3/8
 */
/* eslint-disable */
import '../../../static/js/layui/css/layui.css'

require('script-loader!../../../static/js/layui/layui')
export let layimConf = { isFirst: true, isGetNewMsg: true }

export function layuiInit () {
  return new Promise((resolve, reject) => {
    layui.use('layim', function (layim) {
      if (layim) {
        resolve(layim)
      } else {
        reject(new Error('layim实例化失败'))
      }
    })
  })
}

export function deleteCurrentChatlog () {
  // let cache = layui.layim.cache()
  // let local = layui.data('layim')[cache.mine.id] // 获取当前用户本地数据
  // 这里以删除本地聊天记录为例
  // delete local.chatlog
  // 向localStorage同步数据
  // layui.data('layim', {
  //   key: cache.mine.id,
  //   value: local
  // })
  layimConf.isFirst = false
}
